/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ve.com.cantv.worktables.ejb.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Ghust
 */
@Entity
@Table(name = "activity_participant_type")
@NamedQueries({@NamedQuery(name = "ActivityParticipantType.findAll", query = "SELECT a FROM ActivityParticipantType a"), @NamedQuery(name = "ActivityParticipantType.findByIdapt", query = "SELECT a FROM ActivityParticipantType a WHERE a.idapt = :idapt"), @NamedQuery(name = "ActivityParticipantType.findByName", query = "SELECT a FROM ActivityParticipantType a WHERE a.name = :name"), @NamedQuery(name = "ActivityParticipantType.findByFriendlyName", query = "SELECT a FROM ActivityParticipantType a WHERE a.friendlyName = :friendlyName")})
public class ActivityParticipantType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idapt")
    private Integer idapt;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Column(name = "friendly_name")
    private String friendlyName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idActivityPartipantType")
    private List<ActivityToActivityParticipantType> activityToActivityParticipantTypeCollection;

    public ActivityParticipantType() {
    }

    public ActivityParticipantType(Integer idapt) {
        this.idapt = idapt;
    }

    public ActivityParticipantType(Integer idapt, String name) {
        this.idapt = idapt;
        this.name = name;
    }

    public Integer getIdapt() {
        return idapt;
    }

    public void setIdapt(Integer idapt) {
        this.idapt = idapt;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFriendlyName() {
        return friendlyName;
    }

    public void setFriendlyName(String friendlyName) {
        this.friendlyName = friendlyName;
    }

    public List<ActivityToActivityParticipantType> getActivityToActivityParticipantTypeCollection() {
        return activityToActivityParticipantTypeCollection;
    }

    public void setActivityToActivityParticipantTypeCollection(List<ActivityToActivityParticipantType> activityToActivityParticipantTypeCollection) {
        this.activityToActivityParticipantTypeCollection = activityToActivityParticipantTypeCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idapt != null ? idapt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ActivityParticipantType)) {
            return false;
        }
        ActivityParticipantType other = (ActivityParticipantType) object;
        if ((this.idapt == null && other.idapt != null) || (this.idapt != null && !this.idapt.equals(other.idapt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.com.cantv.worktables.ejb.entity.ActivityParticipantType[idapt=" + idapt + "]";
    }

}
